package org.logsin37.tool.eurekamanager.infra.remote;

import org.logsin37.tool.eurekamanager.domain.entity.EurekaApplication;
import org.logsin37.tool.eurekamanager.domain.entity.EurekaInstance;
import org.logsin37.tool.eurekamanager.infra.constant.EurekaInstanceStatus;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

/**
 * Eureka Remote Client
 *
 * @author logsin37 2020/01/19 16:13
 */
public interface EurekaRemoteClient {

    /**
     * 获取绑定的Eureka Code
     *
     * @return 绑定的Eureka Code
     */
    String getEurekaCode();

    /**
     * 获取所有的Eureka Application
     *
     * @return 所有的Eureka Application
     */
    Flux<EurekaApplication> listAllApplications();

    /**
     * 更改指定Eureka实例的状态
     *
     * @param instance 实例, app/instanceId不能为空
     * @param status 目标状态
     * @return 修改结果
     */
    Mono<Void> putStatus(EurekaInstance instance, EurekaInstanceStatus status);
}
